sgdk
maths3D.h
Go to the documentation of this file.
00001 
00016 #ifndef _MATHS3D_H_
00017 #define _MATHS3D_H_
00018 
00019 
00024 typedef struct
00025 {
00026     Vect2D_u16 viewport;
00027     fix16 camDist;
00028     Vect3D_f16 light;
00029     u16 lightEnabled;
00030 } Context3D;
00031 
00032 
00037 typedef Vect3D_f16 Translation3D;
00038 
00043 typedef Vect3D_f16 Rotation3D;
00044 
00045 
00053 typedef struct
00054 {
00055     u16 rebuildMat;
00056     Translation3D *translation;
00057     Rotation3D *rotation;
00058     Mat3D_f16 mat;
00059     Mat3D_f16 matInv;
00060     Vect3D_f16 cameraInv;
00061     Vect3D_f16 lightInv;
00062 } Transformation3D;
00063 
00068 void M3D_reset();
00069 
00074 void M3D_setLightEnabled(u16 enabled);
00079 u16  M3D_getLightEnabled();
00080 
00090 void M3D_setViewport(u16 w, u16 h);
00098 void M3D_setCamDistance(fix16 value);
00103 void M3D_setLightXYZ(fix16 x, fix16 y, fix16 z);
00108 void M3D_setLight(Vect3D_f16 *value);
00109 
00114 void M3D_resetTransform(Transformation3D *t);
00115 
00120 void M3D_setTransform(Transformation3D *tr, Translation3D *t, Rotation3D *r);
00121 
00126 void M3D_setTranslation(Transformation3D *t, fix16 x, fix16 y, fix16 z);
00133 void M3D_setRotation(Transformation3D *t, fix16 x, fix16 y, fix16 z);
00134 
00147 void M3D_combineTransform(Transformation3D *left, Transformation3D *right, Transformation3D *result);
00160 void M3D_combineTranslationLeft(Translation3D *left, Transformation3D *right, Transformation3D *result);
00173 void M3D_combineTranslationRight(Transformation3D *left, Translation3D *right, Transformation3D *result);
00174 
00183 void M3D_buildMat3D(Transformation3D *t);
00192 void M3D_buildMat3DOnly(Transformation3D *t);
00200 void M3D_buildMat3DExtras(Transformation3D *t);
00201 
00213 void M3D_translate(Transformation3D *t, Vect3D_f16 *vertices, u16 numv);
00227 void M3D_rotate(Transformation3D *t, const Vect3D_f16 *src, Vect3D_f16 *dest, u16 numv);
00239 void M3D_rotateInv(Transformation3D *t, const Vect3D_f16 *src, Vect3D_f16 *dest);
00253 void M3D_transform(Transformation3D *t, const Vect3D_f16 *src, Vect3D_f16 *dest, u16 numv);
00254 
00266 void M3D_project_f16(const Vect3D_f16 *src, Vect2D_f16 *dest, u16 numv);
00278 void M3D_project_s16(const Vect3D_f16 *src, Vect2D_s16 *dest, u16 numv);
00279 
00280 
00281 #endif // _MATHS3D_H_
 All Classes Files Functions Variables Typedefs Enumerations Defines